<template>
  <div>
    <div>我是C组件 我的值是：{{ flag }}</div>
    <div><button @click="emitB">给D传值</button></div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import Bus from "./bus";
let flag = ref(true);
const emitB = () => {
  flag.value = !flag.value;
  Bus.emit("toD", flag);
};
</script>

<style>
</style>